This release note gives a brief description of how the sample Graphics applications work, and a few tips about re-building the samples.
The files contained in this folder are sample applications which demonstrate some of the uses and capabilities of the graphics package. All of the samples included are designed to be compiled under Think C 5.0 or MPW v3.2. Think C v6.0 "Project" files are included for each sample application. For the projects files to compile properly, you would need to drag the folder contained in the "Interfaces & Libraries" onto your hard disk. Also, the the majority of the samples expect the source code to be at the same directory level as the projects. All of the samples were built with THINK 6.0, with the projects and QuickdRaw GX interface and library files within the THINK 6.0 "Projects" folder. You can also MPW v3.2 to build the samples.
At times, you _might_ find yourself in the debugger, with a "GRAPHICS NOTICE: _____" , if this occurs, the GX system is telling you that the application is performing a taks whihc _might_ be avoided. You can type "g" to continue. By the way, you will only receive a notice if you are running the "debugging" version of the QuickDraw GX init.
Brief Descriptions
----------------
All Shapes - This sample creates all of the GX graphics primitive shapes.
Bitmap shape with unique clip - this application retrieves a bitmap shape from it's resource fork and applies a text shape clip to the bitmap shape.
Bouncing Bitmap - This sample demonstrates the capabilities of the graphics system to manipulate and draw bitmaps. Each time the bitmap is drawn, it location's will change, and the object will be rotated. If the object hits the edge of the window, it will bounce back.
Caps Attached To a Curve - We create a curve and attach a cap to each end.
Cubic Curve to GX Quad Curve (TestCubics) - This applications demonstrates the use of the "Cubic Library" to represent a quadratic Bezier approximation of cubic Bezier.
Dashing Text - dashes a line of text along a curve.
GXOffscreens, GWorlds, Movies - This application uses the QuickDraw GX offscreen library, QuickDraw's GWorlds, and QuickTime v1.5 to play a QuickTime movie and rotate it with QuickDraw GX.
Grayscale Bitmap - We create a 1 pixel high by 256 pixel bitmap and assign a gray value to each pixel. We will the use ScaleShape to scale the bitmap shape by 40 in th ey direction.
House Picture - This sample demonstrates the picture creation capabilities of the graphics system. We create a picture of a house by adding 7 different shapes to the picture. Each shape has a different size, color, and style.
mode - This sample allows you to change the transfer mode that is used to draw the text on top of a colored background. It will also allow you to set the color and type of updating used by the application. NOTE: On occasion, pixels may remain on the screen from the spinning text. This reflects the pre-alpha state.
Offscreen Animation - Uses the QuickDraw GX offscreen library to simulate rectangles flying through space.
One Rectangle - Creates a black rectangle.
Paths & Frames - This sample demonstrates the framing capabilities of the graphics system. We create a shape containing a letter, rectangle, and a oval. We will then draw the shape in a different colors and frames.
Patterned Curve - We create a "thick" curve and fill it with a star pattern.
Pen Play - Creates various paths, and adjusts the pen size and location (i.e. the pen placed: on, inset, and outside of the geometry of the shape).
Perspective Sample - This sample application retrieves a pixmap and converts it to a shape. We will then run the shape through a transform which will skew it, when drawn.
QuickDraw GX Scrolling - Demonstrates the method which should be used to scroll QuickDraw GX shapes within a window.
Rotating Rects - This sample application will create a rectangle the size of the window. It will then rotate, scale, and color the rectangle before re-drawing it. The color is derived from the hsv color space.
ShapePart Browser - This application displays several types of shapes with various features. Beside these are series of check boxes corresponding to all the shape parts recognized by the routine HitTestShape. As the cursor is positioned over each shape the parts hit-tested by the given point are highlighted on the corresponding check boxes. Unchecking a check box keeps the shape part from being tested.
Since the glyph (and text) shape cannot have an edge, join, start or end cap these bits of the shape part field are interpreted differently by the graphics system to mean glyph bounds, glyph first, glyph last and side bearings instead.
The Metrics menu allows the shape's bounding boxes (command-B) and control points (command-P) to be shown. The cursor may be moved automatically (command-M) until the mouse is moved again by the user.
Spinning Text - This sample application will create a string of text and rotate it, and color it with an hsv color.
Spinning Colored Ovals - This sample creates an oval slightly smaller than the window. We will then rotate and color each oval. The oval is drawn twice. Once for the outside oval, and the second time to fill the inside oval. The oval is colored in an hsv color.
TextCubics - This sample converts a cubic Bezier to a quadratic Bezier using the "Cubic Library". Click on three locations within the window to define the points which represent the curve. You have the ability to set the amount of error and the number of points used for the conversion via the menus.
Text To Outline- Creates a text shapes and converts it to a path shape. The path shape will then contain the outlines of each character of the original string we had created.
viewPort Mania - This sample demonstrates the multiple viewPort capabilities of the new graphics system. We create 6 child viewPorts and attach them to the parent viewPort of the window. We will then change the attributes of each viewPort, which allows the shape to be drawn to the particular viewPort in a different color space, scale, or halftone. We will then draw the same shape simultaneously to all of the viewPorts.